package Static;

public class ArrayUtil {
    private ArrayUtil(){}//私有化构造函数

    //定义工具方法；
    //打印int[] -> String
    public static String printArr(int[] arr){
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        for (int i = 0; i < arr.length; i++) {
            if (i==arr.length-1){
                sb.append(arr[i]);
            }else {
                sb.append(arr[i]).append(",");
            }
        }sb.append("]");
        return sb.toString();
    }
    //
}
